feat: phase 5 observability — metrics, enriched INFO, slowlog - #40
Merged
Conversation
…, stats, keyspace sections
INFO with no args returns all sections. INFO <section> returns just
that section. follows Redis conventions — # headers, key:value pairs.
sections:
- server: ember_version, process_id, uptime_in_seconds, shard_count
- clients: connected_clients, max_clients
- memory: used_memory, used_memory_human, max_memory, max_memory_human
- persistence: aof_enabled
- stats: total_connections_received, total_commands_processed,
expired_keys, evicted_keys
- keyspace: db0:keys=N,expires=N,used_bytes=N
adds ServerContext struct (shared via Arc) that tracks start_time,
version, config, and atomic counters for connections/commands.
implements SLOWLOG GET [count], SLOWLOG LEN, and SLOWLOG RESET with a fixed-size ring buffer (default 128 entries). commands exceeding the threshold are recorded with id, timestamp, duration, and command name. CLI flags: - --slowlog-log-slower-than: microseconds threshold (default 10000 = 10ms, -1 to disable, 0 to log everything) - --slowlog-max-len: ring buffer capacity (default 128) the slow log is shared across connections via Arc<SlowLog>. the inner mutex is effectively uncontended since only slow commands (rare by definition) ever acquire it. the threshold check itself is a single duration comparison — ~1ns overhead per command. also simplifies the process() timing: Instant::now() is always taken (needed for slowlog), and metrics recording is gated separately.
kacy
added a commit
that referenced
this pull request
Feb 11, 2026
feat: phase 5 observability — metrics, enriched INFO, slowlog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
summary
rolls up the three observability PRs (#37, #38, #39) into main:
--metrics-portflag, per-command counters/histograms, background stats poller, connection gaugesServerContextfor shared stateSLOWLOG GET/LEN/RESET, configurable threshold and max lengthtested
cargo test --workspace— all tests passcargo clippy --workspace -- -D warnings— clean